/*
 * =====================================================================================
 *
 *       Filename:  MediaRecordTask.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  04/21/2015 03:00:31 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Dellinger.Zhang (mn), rainxy2000@hotmail.com
 *        Company:  TD studio
 *
 * =====================================================================================
 */
#ifndef __MEDIARECORDTASK_H__
#define __MEDIARECORDTASK_H__

#include "def.h"
#include "ctTCPTaskPool.h"
#include "ctTCPTask.h"
#include "ctMisc.h"
#include "command.h"

class MediaRecordTask : public ctTCPTask
{
	public:
		MediaRecordTask(ctTCPTaskPool *pool,
						const int sock, 
						const struct sockaddr_in *addr = NULL);
		virtual ~MediaRecordTask() {}

	public:
		virtual bool verify(const Cmd::t_NullCmd *pNullCmd);
		virtual int	 verifyConn();
		virtual int  waitSync();
		virtual void addToContainer();
		virtual void removeFromContainer();
		virtual bool uniqueAdd();
		virtual bool uniqueRemove();

		bool msgParse(const Cmd::t_NullCmd *pcmd, const DWORD nCmdLen);
		bool msgParse_room(const Cmd::t_NullCmd *pcmd, const DWORD nCmdLen);

	public:
		WORD getType() const { return server_type_; }
		DWORD getID() const { return server_id_; }

	private:
		WORD	server_type_;
		DWORD	server_id_;
};

#endif //__MEDIARECORDTASK_H__
